import React, { ChangeEvent, FC, useState } from "react"

const Demo: FC = () => {
  //   const [text, setText] = useState("hello")
  //   function handleChange(event: ChangeEvent<HTMLTextAreaElement>) {
  //     setText(event.target.value)
  //   }

  //   function genHtml() {
  //     return { __html: text.replaceAll("\n", "<br/>") }
  //   }

  return (
    <>
      <p>Form ELems Demo</p>
      <div>
        {/* <input value={text} onChange={handleChange} /> */}

        {/* <textarea value={text} onChange={handleChange}></textarea>
        {text.replaceAll("\n", "<br />")}为防止XSS攻击，替换的标签被转换为字符串
        <p dangerouslySetInnerHTML={genHtml()}></p> */}

        
      </div>
    </>
  )
}

export default Demo
